
const nowMode = 0 // 0为线上模式
const version = '2.1.8'

const prodPath = 'https://api.evooil.com.my'
const devPath = {
  path1: 'http://backend.xiaoka98.cn',
  path2: 'http://192.168.0.188:9601',
  path3: 'http://127.0.0.1:50050',
  path4: 'http://192.168.0.155:50050'
}

function getPath() {
  if (nowMode > 0) {
    return devPath['path' + nowMode]
  }
  return prodPath
}
export const BASEURL = getPath()

export const picPath = 'https://res.evooil.com.my/static'
// export const picPath = BASEURL + '/purchase'

export const adminV = 1
export const agencyV = 2
export const dealerMV = 3
export const dealerV = 4
export const checkPageUpdate = function() {
  const versionStr = localStorage.getItem('version') ? localStorage.getItem('version') : null
  if (versionStr) {
    if (versionStr !== version) {
      localStorage.setItem('version', version)
      location.reload()
    }
  } else {
    localStorage.setItem('version', version)
  }
} // 版本号自动更新
export const regionList = [
  { cn: '玻璃市州', en: 'Negeri Perlis', id: '' },
  { cn: '槟城州', en: 'State of Penang', id: '' },
  { cn: '吉打州', en: 'Negeri Kedah', id: '' },
  { cn: '霹雳州', en: 'Negeri Perak', id: '' },
  { cn: '吉兰丹州', en: 'Kelantan', id: '' },
  { cn: '登嘉楼', en: 'Negeri Terengganu', id: '' },
  { cn: '彭亨州', en: 'Pahang', id: '' },
  { cn: '吉隆坡', en: 'Kuala Lumpur', id: '' },
  { cn: '雪兰莪州', en: 'Negeri Selangor', id: '' },
  { cn: '森美兰州', en: 'Negeri Sembilan', id: '' },
  { cn: '马六甲州', en: 'Melaka', id: '' },
  { cn: '柔佛州', en: 'Johor', id: '' },
  { cn: '沙巴州', en: 'Negeri Sabah', id: '' },
  { cn: '砂拉越州', en: 'Negeri Sarawak', id: '' }
]
// <el-option v-for="(item, index) in $regionList" :label="item.en" :value="item.en" :key="index"></el-option>

export const orderStateList = [
  { label: 'Menunggu Pembayaran', value: 0 },
  { label: 'Pembayaran Lengkap', value: 1 },
  { label: 'Mula Penghantaran', value: 2 },
  { label: 'Dalam Penghantaran', value: 3 },
  { label: 'Ketibaan', value: 4 },
  { label: 'Diterima', value: 5 },
  { label: 'Dibatal', value: -2 }
]

